package cn.broadsense.biz.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * 查询字段枚举
 *
 * @author: pengxin
 * @create: 2024-04-12 10:04
 * @Version 1.0
 **/
@Getter
@AllArgsConstructor
public enum ChannelFieldEnum {

    CHANNEL_CODE("channel_code", "设备编码"),
    CHANNEL_NAME("channel_name", "设备名称"),
    CAMERA_TYPE("camera_type", "设备类型"),
    DEPT_NAME("dept_name", "所属组织"),
    CHANNEL_NUM("channel_num", "通道号"),
    PROTOCOL("protocol", "协议"),
    IP_ADDRESS("ip_address", "ip地址"),
    STAGE_TAG("stage_tag", "阶段标识"),
    MODEL("model", "摄像机型号"),
    PIXEL("pixel", "像素"),
    ABILITY("ability", "功能应用"),
    COLUMN_HEIGHT("column_height", "立杆高度"),
    INSTALL_ADDRESS("install_address", "安装位置"),
    COLUMN_LENGTH("column_length", "横臂长度"),
    GPS_X("gps", "经纬度"),
    COLUMN_CODE("column_code", "杆件编码"),
    ORIENTATION("orientation", "朝向"),
    ;

    /**
     * 数据库字段
     */
    private String filedNameDb;

    /**
     * 显示字段
     */
    private String filedName;

    public static String getFiledName(String filedNameDb) {
        for (ChannelFieldEnum fieldEnum : ChannelFieldEnum.values()) {
            if (fieldEnum.getFiledNameDb().equals(filedNameDb)) {
                return fieldEnum.getFiledName();
            }
        }
        return null;
    }

}
